/**
 * Created by vincent on 2017/9/21.
 */
moduleStudyMap.controller("EditTaskStudyController", function ($$CambioConfig, $scope, $log, $state, LoadingService, EnumService,
                                                               UploadFileService, ConstantService, TaskStudyResource, DialogService) {
    $scope.$on("ngDialog.opened", function () {
        dialogOnLoad();
    });

    $scope.cancel = function () {
        DialogService.close();
    };

    $scope.submit = function () {
        if ($scope.editTSForm.$valid) {
            //LoadingService.show();
            TaskStudyResource.update($scope.editingTaskStudy, function (taskStudyResult) {
                $log.debug("课程任务更新结果", taskStudyResult);
                angular.copy(taskStudyResult, $scope.currentTaskStudy);
                DialogService.close();
                Alert.success("更新任务成功！");
                //LoadingService.hide();
            });
        }
    };

});